<%@ tag language="java" pageEncoding="utf-8" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="lookup" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ attribute name="doc" type="com.eischet.lookup.web.SearchResult" required="true" %>
<%@ attribute name="title" type="java.lang.String" required="false" %>
<%@ attribute name="bytitle" type="java.lang.String" required="false" %>
<%@ attribute name="tsfield" type="java.lang.String" required="false" %>
<%@ attribute name="byfield" type="java.lang.String" required="false" %>
<span class="timestamp"><%

    //System.err.println(String.format("display:timestamp title=%s bytitle=%s tsfield=%s byfield=%s", title, bytitle, tsfield, byfield));

    String ts = doc.getTimestamp(tsfield);
    String by = doc.getField(byfield);

    //System.err.println(String.format("display:timestamp ts=%s by=%s", ts, by));

    if (ts != null && !ts.isEmpty()) {
        if (title != null && !title.isEmpty()) { %><%=title%><% }
        %> <%=ts%><%
        if ((byfield != null) && (!byfield.isEmpty()) && (by != null) && !by.isEmpty()) {
            if (bytitle != null && !bytitle.isEmpty()) { %> <%=bytitle%> <% }
            %> <%=by%><%
        }
    }
%></span>
